package com.qf.bank.funapi.api;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qf.bank.funapi.fallback.FunApiError;
import com.qf.bank.funapi.po.Fun;
import com.qf.bank.funapi.vo.FunVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * Create on 2019/12/6 11:48
 *
 * @author 飞
 */

@FeignClient(value = "fun-provider", fallback = FunApiError.class)
public interface FunApi {
    /**
     * 分页查询
     */
    @RequestMapping(value = "/", method = RequestMethod.GET)
    public Page<Fun> page(@RequestBody FunVo funVo);
    /**
     * 根据id查询
     * @param
     * @return
     */
    @RequestMapping(value = "/{funId}",method = RequestMethod.GET)
    public Fun getById(@PathVariable("funId")int funId);
    /**
     * 根据id删除
     * @param funId
     * @return
     */
    @RequestMapping(value = "/{funId}",method = RequestMethod.DELETE)
    public Boolean deleteById(@PathVariable("funId")int funId);
    /**
     * 添加一个功能
     * @param fun
     * @return
     */
    @RequestMapping(value = "/",method = RequestMethod.POST)
    public Boolean getinsert(@RequestBody Fun fun);
    /**
     * 修改功能
     * @param fun
     * @return
     */
    @RequestMapping(value = "/",method = RequestMethod.PUT)
    public Boolean updateById(@RequestBody Fun fun);
}
